Ext.onReady(function() {

	var win = Ext.create('Ext.window.Window', {
		title: 'Hello',
		height: 200,
		width: 400,
		layout: 'fit',
		items: {
			//子组件
			xtype: 'form',
			id: 'passpanel',
			frame: false,
			labelAlign: 'right',
			labelWidth: 80,
			bodyStyle: 'padding-top:10px',
			defaultType: 'textfield',   //定义子组件的类型，默认是panel
			items: [{

				fieldLabel: '用户代码',
				id: 'userCode',
				disabled: false,
				// anchor: '90%'

			}, {
				fieldLabel: '密码',
				id: 'userPwd',

			}]
		},
		listeners: {
			'beforeclose': function() {
				var uCode=  Ext.getCmp('userCode').getValue();
				alert(uCode);
				if(uCode == null || uCode == undefined || uCode == '') {
					Ext.Msg.alert('警告','你的密码为弱密码，请及时修改！');	
				}
			}

		}

	});

	win.show();

});